<template>
  <div class="play-item" @click="$router.push(`/music/songListDetail/${props.playDetail.id}`)">
    <div class="play-item_cover">
      <img :src="`${props.playDetail.coverImgUrl}?param=100y100`" alt="" />
    </div>
    <div class="play-item_info">
      <div class="play-item_info_name show-one-line">{{ props.playDetail.name }}</div>
      <div class="play-item_info_detail show-one-line">
        {{ props.playDetail.trackCount }}首,by {{ props.playDetail.creator.nickname }}, 播放{{
          props.playDetail.playCount
        }}次
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import type { ISongListItem } from "@/types/music/songLIstType";

const props = defineProps<{
  color: string;
  lightColor: string;
  playDetail: ISongListItem;
}>();
</script>

<style scoped lang="scss">
.play-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  color: v-bind("props.color");
  &_cover {
    border-radius: 10px;
    overflow: hidden;
    width: 60px;
    height: 60px;
    margin-right: 20px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  &_info {
    flex: 1;
    height: 55px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    overflow: hidden;
    &_name {
      font-size: 18px;
    }
    &_detail {
      font-size: 14px;
      color: v-bind("props.lightColor");
    }
  }
}
</style>
